﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace FinalMoviles
{
    public partial class FrmFactura : Form
    {
        public FrmFactura()
        {
            InitializeComponent();
        }

        private void lblfecha_ParentChanged(object sender, EventArgs e)
        {

        }

        private void menuItem2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItem1_Click(object sender, EventArgs e)
        {
            Menu fact = new Menu();
            this.Hide();
            fact.ShowDialog();
            this.Show();
        }

        private void cmdBuscar_Click(object sender, EventArgs e)
        {
            swDatos.Service objServicio = new swDatos.Service();
            DataTable dttMovil;
            dttMovil = objServicio.ObtenerFacturasPorFechas(clsGlobales.Global_cve_cia, clsGlobales.Global_cve_cte, dtInicial.Value.ToShortDateString(), dtFinal.Value.ToShortDateString());         
            dgFacturas.DataSource = dttMovil;            
        }

        private void dgFacturas_Click(object sender, EventArgs e)
        {            
            swDatos.Service objServicio = new swDatos.Service();
            DataTable dttMovil;

            dttMovil = objServicio.ObtenerDetalleFactura(Convert.ToInt16(dgFacturas[dgFacturas.CurrentRowIndex, 0].ToString()));
            dgDetalles.DataSource = dttMovil;
        }

        private void dgFacturas_CurrentCellChanged(object sender, EventArgs e)
        {

        }
    }
}